home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / extras / programm / a56 / examples / flange.lis < prev    next >
File List  |  1995-04-27  |  11KB  |  327 lines

  1.               ;***************************************************************
  2.               ;
  3.               ;       Stereo Flange for the DSP56001 processor
  4.               ;       Developed by Quinn Jensen (jensenq@qcj.icon.com)
  5.               ;
  6.               ;***************************************************************
  7.               include "tdsg.a56"
  8.               
  9. P:0076        dot
  10. X:0020                org     x:$20
  11.               
  12.               ; Sample rate              32.5500 kc         
  13.               ; 
  14.               ; Delay time (1-12)         6.0000 ms         
  15.               ; Depth (1-10)             10.0000
  16.               ; Speed (1-10)              1.0000
  17.               ; Regen (1-10)              9.0000
  18.               ; 
  19.               ; max depth +/-             6.0000 ms         
  20.               ; min delay                 1.0000 ms         
  21.               ; max delay                12.0000 ms         
  22.               ; 1/2 cycle period          4.5100 s          
  23.               ; samples per 1/2 cyc  146800.5000
  24.               ; time delta/samp           0.0817 us         
  25.               ; offset samp/samp          0.0027
  26.               ; 
  27. FFFFDF          doff_i equ                               -33
  28. 0.00266075      ddeltaf equ                     0.0026607539
  29. 023D70          dspeed_i equ                          146800
  30.   0.888889      dregen equ                      0.8888888889
  31.               
  32. 002000        delay   equ     $2000
  33. 001000        dmax    equ     4096            ;125 ms
  34. X:0020 FFFFDF doff    dc      doff_i          ;current delay distance
  35. Y:0020                org     y:doff
  36. Y:0020 000000         dc      0
  37.               
  38. X:0021                org     x:doff+1
  39. X:0021 000000 ddelta  dc      0               ;
  40. Y:0021                org     y:ddelta
  41. Y:0021 005730         dc      ddeltaf
  42.               
  43. X:0022                org     x:ddelta+1
  44.               
  45. X:0022 023D70 dspeed  dc      dspeed_i
  46. X:0023 000000 dtoggle dc      0               ;
  47. X:0024        delayout
  48. X:0024 000000         dc      0
  49.               
  50. Y:0000                org     y:$0
  51.               
  52. P:0076                org     p:dot           ;go back to P-space
  53.               ;
  54.               ; non-interrupt code
  55.               ;
  56.               
  57. P:0076        hf_init
  58. P:0076 61F400         move    #delay,r1                       ;delay line input
  59. P:0077 002000
  60. P:0078 05F421         movec   #dmax-1,m1                      ;
  61. P:0079 000FFF
  62. P:007A 71F400         move    #doff_i,n1                      ;distance to output
  63. P:007B FFFFDF
  64. P:007C 00000C         rts
  65.               
  66.               ;
  67.               ; fs = 32.552083 kHz
  68.               ;
  69.               
  70. P:007D        hf_comp
  71. P:007D 0D0066         jsr     <saveregs
  72.               ;
  73.               ;       output and input mix
  74.               ;
  75. P:007E 253813         clr     a       #.4375,x1               ;clr a, get input scale
  76. P:007F 27401B         clr     b       #.5,y1                  ;clr b, get output scaler
  77.               
  78. P:0080 46A400         move            x:<delayout,y0          ;get delay out
  79.               
  80. P:0081 44F400         move            #.70,x0                 ;do regen term
  81. P:0082 59999A
  82. P:0083 2000D3         macr    x0,y0,a
  83. P:0084 2000D3         macr    x0,y0,a
  84.               
  85. P:0085 246000         move            #.75,x0
  86.               
  87. P:0086 4480DB         macr    y0,x0,b x:<in_l,x0              ;b = .5 * delay, x0=in_l
  88. P:0087 21E6CB         macr    x0,y1,b         b,y0            ;b += .5 * in_l, y0=b
  89. P:0088 5704A3         macr    x0,x1,a b,x:<out_l              ;a += x1 * in_l, L = b
  90. P:0089 20CF00         move                    y0,b            ;b = -y0
  91. P:008A 44813E         neg     b       x:<in_r,x0              ;x0 = in_r
  92. P:008B 2000CB         macr    x0,y1,b                         ;b += .5 * in_r
  93. P:008C 5705A3         macr    x0,x1,a b,x:<out_r              ;R = b, a += x1 * in_r
  94.               ;
  95.               ;       delay line in
  96.               ;
  97. P:008D 565900         move            a,x:(r1)+
  98.               ;
  99.               ;       delay line length modulation
  100.               ;
  101. P:008E 48A000         move            l:<doff,a               ;a = current offset
  102. P:008F 42A100         move            l:<ddelta,x             ;x = current delta
  103. P:0090 200020         add     x,a
  104. P:0091 482000         move            a,l:<doff               ;new offset = a + x
  105. P:0092 219900         move            a1,n1
  106.               
  107. P:0093 20AF00         move            x1,b                    ;save delta for later use
  108.               
  109.               ; smoothly transition between delay-line offsets by
  110.               ; interpolating the current sample with the previous or next
  111.               ; one depending on whether the delay is currently getting longer or
  112.               ; shorter.  Otherwise, an obnoxious click results when the offset snaps
  113.               ; to the next integral value.
  114.               
  115. P:0094 5EA000         move                    y:<doff,a       ;compute |frac(doff)|
  116. P:0095 44F423         lsr     a       #$800000,x0
  117. P:0096 800000
  118. P:0097 254042         or      x0,a    #.5,x1
  119. P:0098 218400         move            a1,x0
  120. P:0099 2000A4         mpy     -x0,x1,a
  121. P:009A 21C60B         tst     b               a,y0            ;y0 = 0.5 * |frac(doff)|
  122. P:009B 0AF0A3         jpl     shorter                         ;on positive delta, the
  123. P:009C 0000A6
  124.                                                               ;delay is shortening
  125.               
  126. P:009D 205100         move            (r1)-                   ;get previous sample
  127. P:009E 44E900         move            x:(r1+n1),x0
  128. P:009F 2F40D0         mpy     y0,x0,a #.5,b                   ;scale
  129. P:00A0 20595C         sub     y0,b    (r1)+                   ;compute scale for cur sample
  130. P:00A1 21E600         move                    b,y0
  131. P:00A2 44E900         move            x:(r1+n1),x0            ;get cur sample
  132. P:00A3 2000D2         mac     x0,y0,a                         ;scale and sum
  133. P:00A4 0AF080         jmp     endpan
  134. P:00A5 0000AC
  135.               
  136. P:00A6        shorter
  137. P:00A6 44E900         move            x:(r1+n1),x0            ;get cur sample
  138. P:00A7 2F40D0         mpy     y0,x0,a #.5,b                   ;scale
  139. P:00A8 20595C         sub     y0,b    (r1)+                   ;compute scale for next sample
  140. P:00A9 21E600         move                    b,y0
  141. P:00AA 44E900         move            x:(r1+n1),x0            ;get next sample
  142. P:00AB 2051D2         mac     x0,y0,a (r1)-                   ;scale and sum
  143. P:00AC        endpan
  144. P:00AC 562400         move            a,x:<delayout           ;store resulting output
  145.               
  146.               ; update the triangle wave modulation
  147.               
  148. P:00AD 56A300         move            x:<dtoggle,a            ;decrement toggle count
  149. P:00AE 44F400         move            #>1,x0
  150. P:00AF 000001
  151. P:00B0 200044         sub     x0,a
  152. P:00B1 562300         move            a,x:<dtoggle
  153. P:00B2 0AF0A7         jgt     notogg                          ;time to toggle?
  154. P:00B3 0000B8
  155. P:00B4 44A200         move            x:<dspeed,x0            ;yes, negate delta and reset
  156. P:00B5 48A100         move            l:<ddelta,a
  157. P:00B6 442336         neg     a       x0,x:<dtoggle
  158. P:00B7 482100         move            a,l:<ddelta
  159. P:00B8        notogg
  160. P:00B8        bypass
  161. P:00B8 0D006F         jsr     <restregs
  162. P:00B9 00000C         rts
  163.               
  164.                       end
  165.  
  166. Summary of psect usage
  167.  
  168.                  section seg base last top      used       avail    total
  169. -------------------------------------------------------------------------
  170.  
  171.  
  172. Symbol Table
  173. -------------------------------------
  174.           ddelta 000021
  175.          ddeltaf 0.0026607539
  176.          ssi_int 000061
  177.             ssix 000010
  178.           notogg 0000B8
  179.         delayout 000024
  180.            delay 002000
  181.      init_stereo 000059
  182.            start 000040
  183.            in_rs 000003
  184.            in_ls 000002
  185.             in_r 000001
  186.             in_l 000000
  187.             dmax 001000
  188.           endpan 0000AC
  189.             doff 000020
  190.           doff_i FFFFDF
  191.              dot 000076
  192.         mainloop 000060
  193.          hf_comp 00007D
  194.          hf_init 000076
  195.          dtoggle 000023
  196.         saveregs 000066
  197.            savey 00000B
  198.            savex 00000A
  199.           saveb2 000009
  200.          saveb10 000008
  201.           savea2 000007
  202.          savea10 000006
  203.           dregen 0.8888888889
  204.           dspeed 000022
  205.         dspeed_i 023D70
  206.         restregs 00006F
  207.            out_r 000005
  208.            out_l 000004
  209.           bypass 0000B8
  210.          shorter 0000A6
  211.           m_scl1 00000F
  212.           m_scl0 00000E
  213.            m_scl 00C000
  214.           m_ssl1 00000D
  215.           m_ssl0 00000C
  216.            m_ssl 003000
  217.           m_hpl1 00000B
  218.           m_hpl0 00000A
  219.            m_hpl 000C00
  220.           m_ibl2 000005
  221.           m_ibl1 000004
  222.           m_ibl0 000003
  223.            m_ibl 000038
  224.           m_ial2 000002
  225.           m_ial1 000001
  226.           m_ial0 000000
  227.            m_ial 000007
  228.            m_ipr 00FFFF
  229.            m_rdf 000007
  230.            m_tde 000006
  231.            m_roe 000005
  232.            m_tue 000004
  233.            m_rfs 000003
  234.            m_tfs 000002
  235.            m_if1 000001
  236.            m_if0 000000
  237.             m_if 000002
  238.           m_srie 00000F
  239.           m_stie 00000E
  240.            m_sre 00000D
  241.            m_ste 00000C
  242.            m_mod 00000B
  243.            m_gck 00000A
  244.            m_syn 000009
  245.            m_fsl 000008
  246.           m_sckd 000005
  247.           m_scd2 000004
  248.           m_scd1 000003
  249.           m_scd0 000002
  250.            m_scd 00001C
  251.            m_of1 000001
  252.            m_of0 000000
  253.             m_of 000003
  254.            m_psr 00000F
  255.            m_wl1 00000E
  256.            m_wl0 00000D
  257.             m_wl 006000
  258.             m_dc 001F00
  259.             m_pm 0000FF
  260.            m_tsr 00FFEE
  261.             m_sr 00FFEE
  262.            m_crb 00FFED
  263.            m_cra 00FFEC
  264.             m_tx 00FFEF
  265.             m_rx 00FFEF
  266.            m_tcm 00000F
  267.            m_rcm 00000E
  268.            m_scp 00000D
  269.            m_cod 00000C
  270.             m_cd 000FFF
  271.             m_r8 000007
  272.             m_fe 000006
  273.             m_pe 000005
  274.             m_or 000004
  275.           m_idle 000003
  276.           m_rdrf 000002
  277.           m_tdre 000001
  278.           m_trne 000000
  279.           m_tmie 00000D
  280.            m_tie 00000C
  281.            m_rie 00000B
  282.           m_ilie 00000A
  283.             m_te 000009
  284.             m_re 000008
  285.           m_woms 000007
  286.            m_rwi 000006
  287.           m_wake 000005
  288.            m_sbk 000004
  289.           m_wds2 000002
  290.           m_wds1 000001
  291.           m_wds0 000000
  292.            m_wds 000003
  293.           m_sccr 00FFF2
  294.            m_ssr 00FFF1
  295.            m_scr 00FFF0
  296.           m_stxa 00FFF3
  297.           m_stxh 00FFF6
  298.           m_stxm 00FFF5
  299.           m_stxl 00FFF4
  300.           m_srxh 00FFF6
  301.           m_srxm 00FFF5
  302.           m_srxl 00FFF4
  303.            m_dma 000007
  304.            m_hf1 000004
  305.            m_hf0 000003
  306.             m_hf 000018
  307.            m_hcp 000002
  308.           m_htde 000001
  309.           m_hrdf 000000
  310.            m_hf3 000004
  311.            m_hf2 000003
  312.           m_hcie 000002
  313.           m_htie 000001
  314.           m_hrie 000000
  315.            m_htx 00FFEB
  316.            m_hrx 00FFEB
  317.            m_hsr 00FFE9
  318.            m_hcr 00FFE8
  319.            m_pcd 00FFE5
  320.          m_pcddr 00FFE3
  321.            m_pcc 00FFE1
  322.            m_pbd 00FFE4
  323.          m_pbddr 00FFE2
  324.            m_pbc 00FFE0
  325.            m_bcr 00FFFE
  326. errors=0
  327.